* This files loads all relevant raw data files

/* create raw data folders */
libname raw "G:\Data\Rawdata\702069\views";

/* Firm-level trade data */

data trade;
set raw.Uhdi;
run;
proc export data=trade file="Y:\data\workdata\702069\FAPP2069\tradedata.dta" DBMS=STATA replace;
run;

/* Worker-level data */

/* Matched employer-employee data including person ID, firm ID, occupation, wages */
data idapall;
set raw.Idapall;
if 1998 < aar < 2009;
run;
proc export data=idapall outfile="Y:\data\workdata\702069\FAPP2069\idapall.dta" DBMS=STATA replace;
run;

/* Mapping between jobs and firms */
data matchdata;
set raw.Fida;
run;
proc export data=matchdata outfile="Y:\data\workdata\702069\FAPP2069\fida.dta" DBMS=STATA replace;
run;

/* Labor market experience */
data expyear;
set raw.Expyear;
run;
proc export data=expyear file="Y:\data\workdata\702069\FAPP2069\expyear.dta" DBMS=STATA replace;
run;

/* Firm-level data */

/* Business register: sales, employment, industry */

data firmdata;
set raw.Firm;
run;
proc export data=firmdata file="Y:\data\workdata\702069\FAPP2069\firmdata.dta" DBMS=STATA replace;
run;

/* Accounting data: investment */
data firmdata2;
set raw.Fire;
run;
proc export data=firmdata2 file="Y:\data\workdata\702069\FAPP2069\fire.dta" DBMS=STATA replace;
run;

proc datasets library=work kill;
quit;


